/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package biz;

import entityBean.ClassFacade;
import entity.Class;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author ADMIN
 */
public class classbiz {

    ClassFacade classFacade = lookupClassFacadeBean();
    List<Class> list = new ArrayList<Class>();

    public classbiz() {
    }

    public List<Class> listClassz() {
        list = classFacade.findAll();
        return list;
    }

    private ClassFacade lookupClassFacadeBean() {
        try {
            Context c = new InitialContext();
            return (ClassFacade) c.lookup("java:global/Cms_Portal_Source/Cms_Portal_Source-ejb/ClassFacade!entityBean.ClassFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }
}
